import { storeQiankun } from 'if-qiankun-config'

const qianKunInstance = storeQiankun.Instance

/**
 * 通信方法
 * @param {*} action 动作
 * @param {*} newState 数据
 */
export const dispatchAction = function (action, val) {
  const value = val || {}
  qianKunInstance.actions.setGlobalState({ action, value })
}
